package com.shujia.spark.core

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.rdd.RDD

object Demo14Save {
  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local").setAppName("Demo13Count")
    val sc = new SparkContext(conf)

    val studentsRDD: RDD[String] = sc.textFile("spark/data/students.txt")


    /**
      * saveAsTextFile  可以将数据保存的本地，可以也保存到hdfs   取决于运行方式
      * 会触发job执行
      */
    studentsRDD.saveAsTextFile("spark/data/out2")



  }

}
